pass in value in route group middle ware

88

public function handle($request, Closure $next, $level)
{
    $user = Auth::user();
    if ($user->level > $level) {
        return redirect('testUrl');
    }

    return $next($request);
}
Route::group(['middleware' => 'checkUserLevel:some_value_of_level'], function () {
            // my routes
        });

Comments

Submit
0 Comments